package com.solcoo.json.customer;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

public class DoubleSerializer extends JsonSerializer<Double> {

	@Override
	public void serialize(Double d, JsonGenerator jg, SerializerProvider sp) throws IOException,
			JsonProcessingException {
		System.out.println("d==="+d);
		if(d == null) {
			System.out.println("aaaaa");
			jg.writeNumber(0.0);
		} else {
			jg.writeNumber(d);
		}
	}
	
}
